﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Upload.aspx.cs" Inherits="Common_Upload"
    StylesheetTheme="Content" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>上传文件</title>
</head>
<body>
    <form id="form1" runat="server">
    <br />
    <table cellspacing="0" cellpadding="0" width="100%" class="intable">
        <caption>
            <asp:Label ID="ActionTitle" runat="server" Text="上传文件"></asp:Label></caption>
        <tr>
            <td style="width: 100px;">
                上传文件：
            </td>
            <td>
                <asp:FileUpload ID="FileUpload" runat="server" Width="360px" Height="22px" />
                <asp:Button ID="ButtonUpload" runat="server" OnClick="ButtonUpload_Click" Text="上传" />
            </td>
        </tr>
        <tr>
            <td>
                文件描述：
            </td>
            <td>
                <asp:TextBox ID="Description" runat="server" Width="282px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:Label ID="Prompt" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
    <asp:GridView ID="UserGrid" runat="server" Caption="<span>已上传文件列表</span>" OnRowDataBound="UserGrid_RowDataBound"
        DataKeyNames="FileID" OnRowDeleting="UserGrid_RowDeleting">
        <Columns>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="文件名称">
                <ItemTemplate>
                    <a href="ViewFile.aspx?FileID=<%# Eval("FileID").ToString() %>">
                        <%# Eval("OraginalName").ToString()+"."+Eval("FileExtension").ToString() %></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="大小">
                <ItemTemplate>
                    <%# Yipusoft.Common.BLL.UserFun.GetFileSize((int)Eval("FileSize")) %>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Left" Width="80px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="描述">
                <ItemTemplate>
                    <%# Eval("Description") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:ImageButton ID="ButtonDelete" runat="server" CausesValidation="False" CommandName="Delete"
                        ImageUrl="../images/delete.gif" ToolTip="删除" OnClientClick="return confirm('是否真的删除?')">
                    </asp:ImageButton>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    </form>
</body>
</html>
